package com.ysu.zyw.other.security;

import com.ysu.zyw.modal.po.BlogUserEntity;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

/**
 * Created by zhang_yao_wu1993 on 15/4/24.
 *
 * @author by Zerur
 */
public class BcryptPasswordEncoder {
    public static BlogUserEntity encode(BlogUserEntity blogUserEntity)  {
        BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
        String ciphertext = bCryptPasswordEncoder.encode(blogUserEntity.getPassword());
        blogUserEntity.setPassword(ciphertext);
        return blogUserEntity;
    }
}
